import { Poll } from '../../entities/poll.entity';
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, Min } from 'class-validator';

export class PagePollItemtDto extends Poll {
  @ApiProperty({
    description: '歌手',
    required: false,
    default: '',
  })
  singer: any = '';
  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 10,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageSize: number = 10;

  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 1,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageNo: number = 1;
}

export class addPollDto extends Poll {
  @ApiProperty({
    required: false,
    description: '歌手id',
  })
  singerIds: string[];
}

export class setVoteCount {
  @ApiProperty({
    required: false,
    description: '歌手id',
  })
  singerId: string = '';
}

export class getPollId {
  @ApiProperty({
    required: false,
    description: '项目id',
  })
  pollId: string = '';
}
